<?php

/**
 * dossier filter form base class.
 *
 * @package    e-DSL
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasedossierFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'categorie_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('categorie'), 'add_empty' => true)),
      'type_id'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('type'), 'add_empty' => true)),
      'regionClient_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('regionClient'), 'add_empty' => true)),
      'departementClient_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('departementClient'), 'add_empty' => true)),
      'dateDossier'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'demandeur_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('demandeur'), 'add_empty' => true)),
      'client_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('client'), 'add_empty' => true)),
      'codeClient'               => new sfWidgetFormFilterInput(),
      'nomClient'                => new sfWidgetFormFilterInput(),
      'telClient'                => new sfWidgetFormFilterInput(),
      'mailClient'               => new sfWidgetFormFilterInput(),
      'participants_notifier_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('participants_notifier'), 'add_empty' => true)),
      'dateRealSouhaitee'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'dateReference'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'delaiStandar'             => new sfWidgetFormFilterInput(),
      'ferme'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fermeTechnique'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'external_id'              => new sfWidgetFormFilterInput(),
      'dateDernierRelance'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'brouillon'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'enAttente'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'raisonAttente'            => new sfWidgetFormFilterInput(),
      'supprimer'                => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'urgent'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'justifurgence'            => new sfWidgetFormFilterInput(),
      'dateDebutTraitement'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'dateFinTraitement'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'dateFermeture'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'dateFermetureTechnique'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'duree'                    => new sfWidgetFormFilterInput(),
      'referenceDemande'         => new sfWidgetFormFilterInput(),
      'created_at'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'categorie_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('categorie'), 'column' => 'id')),
      'type_id'                  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('type'), 'column' => 'id')),
      'regionClient_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('regionClient'), 'column' => 'id')),
      'departementClient_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('departementClient'), 'column' => 'id')),
      'dateDossier'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'demandeur_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('demandeur'), 'column' => 'id')),
      'client_id'                => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('client'), 'column' => 'id')),
      'codeClient'               => new sfValidatorPass(array('required' => false)),
      'nomClient'                => new sfValidatorPass(array('required' => false)),
      'telClient'                => new sfValidatorPass(array('required' => false)),
      'mailClient'               => new sfValidatorPass(array('required' => false)),
      'participants_notifier_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('participants_notifier'), 'column' => 'id')),
      'dateRealSouhaitee'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'dateReference'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'delaiStandar'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ferme'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fermeTechnique'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'external_id'              => new sfValidatorPass(array('required' => false)),
      'dateDernierRelance'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'brouillon'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'enAttente'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'raisonAttente'            => new sfValidatorPass(array('required' => false)),
      'supprimer'                => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'urgent'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'justifurgence'            => new sfValidatorPass(array('required' => false)),
      'dateDebutTraitement'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'dateFinTraitement'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'dateFermeture'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'dateFermetureTechnique'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'duree'                    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'referenceDemande'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('dossier_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'dossier';
  }

  public function getFields()
  {
    return array(
      'id'                       => 'Number',
      'categorie_id'             => 'ForeignKey',
      'type_id'                  => 'ForeignKey',
      'regionClient_id'          => 'ForeignKey',
      'departementClient_id'     => 'ForeignKey',
      'dateDossier'              => 'Date',
      'demandeur_id'             => 'ForeignKey',
      'client_id'                => 'ForeignKey',
      'codeClient'               => 'Text',
      'nomClient'                => 'Text',
      'telClient'                => 'Text',
      'mailClient'               => 'Text',
      'participants_notifier_id' => 'ForeignKey',
      'dateRealSouhaitee'        => 'Date',
      'dateReference'            => 'Date',
      'delaiStandar'             => 'Number',
      'ferme'                    => 'Boolean',
      'fermeTechnique'           => 'Boolean',
      'external_id'              => 'Text',
      'dateDernierRelance'       => 'Date',
      'brouillon'                => 'Boolean',
      'enAttente'                => 'Boolean',
      'raisonAttente'            => 'Text',
      'supprimer'                => 'Boolean',
      'urgent'                   => 'Boolean',
      'justifurgence'            => 'Text',
      'dateDebutTraitement'      => 'Date',
      'dateFinTraitement'        => 'Date',
      'dateFermeture'            => 'Date',
      'dateFermetureTechnique'   => 'Date',
      'duree'                    => 'Number',
      'referenceDemande'         => 'Number',
      'created_at'               => 'Date',
      'updated_at'               => 'Date',
    );
  }
}
